<template>
  <div class="baaner">
    <el-carousel indicator-position="outside" height="600px">
      <el-carousel-item v-for="item in tableData" :key="item.id">
        <img :src="item.imgUrl" alt="" class="w-[100%] h-auto" />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script setup lang="ts">
import { getBaaner } from "@/api/system";
import { Baaner } from "@/api/system/system";
import { onMounted, ref } from "vue";

const tableData = ref<Baaner[]>([]);
const listLoading = ref(false);
const getList = async () => {
  listLoading.value = true;
  const res = await getBaaner();
  if (res.code === 200) {
    tableData.value = res.rows;
    listLoading.value = false;
  }
};
onMounted(() => {
  getList();
});
</script>

<style lang="scss" scoped>
.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>
